package main

import "fmt"

type Person struct {
	name string
	sex byte
	age int
}

func (p *Person) SetInfoPointer() {
	(*p).name = "yoyo"
	p.sex = 'f'
	p.age = 22
}


func (p Person) SetInfoValue() {
	p.name = "yoyo"
	p.sex = 'f'
	p.age = 18
}

func main() {
	//指针作为接收者，引用语义
	p := Person{"mike", 'm', 17}
	(&p).SetInfoPointer()
	fmt.Println(p)
	//值作为接受者，值语义
}